<template>
    <div>
        <el-row class="mb10 ml20">
            基金金额:   {{jjMoney | bigMoneyFormat}} 元
        </el-row>
        <exPubTable ref="bankTable" :cfg.sync="bankcfg" :exData="bankList" @getDataList="queryBankInfo"  :diffHeight="30" :defPageSize="100" :show-summary="true"></exPubTable>

    </div>
</template>


<script>

export default {
    props:["qry"],
    data() {
        var that =this;
        return {
            totalMoney: 0,
            jjMoney: 0,
            bankList:[],
            bankcfg:{
                showIndex: true,
                columns: [
                    {prop:"",label:"资金合计(查询全部)",align:"center",
                        columns:[
                            {prop:"day",label:"日期",width:100,sortable:true},
                            {prop:"time",label:"时间",width:100},
                            {prop:"name",label:"存管名称",width:180},
                            {prop:"oper",label:"操作",width:180,sortable:true,getColor(s){return that.getRateColor(s.row.money)}},
                            // {prop:"status",label:"交易状态",width:80},
                            {prop:"money",label:"金额",width:120,sumType:"add",getColor(s){return that.getRateColor(s.row.money)}},
                            {prop:"remark",label:"备注",width:180},
                            {prop:"createtime",label:"创建日期",width:180,sortable:true},
                        ]
                    }
                ],
            },
        }
    },

    mounted() {
    },
    inject:["getQueryInfo"],

    methods: {
        reQuery(){
            if(this.$refs.bankTable) this.$refs.bankTable.reQuery();
        },
        queryBankInfo(){
            var opername = "getBankInfo";
            this.registerListen(this,opername,(res)=>{
                if(res.succ){
                    this.bankList = res.data;
                    this.jjMoney = 0;
                    this.bankList.map(item=>{
                        if(item.day>20201201)
                            this.jjMoney += item.money;
                    })
                    this.jjMoney = Math.abs(this.jjMoney)
                }else{
                    this.$message.error("查询异常:"+res.err)
                }
            });
            
            var param = {type:opername,name:opername,objInfo:{}};
            param.execSql=true;
            param.sql=`select * from bank where status=2 order by tradeno desc`;
            electron.ipcRenderer.send("doSql",param)
        },
    }
    
}
</script>

<style lang="less">

</style>
